package com.beyondsoft.sabg.edu.repository;

import com.beyondsoft.sabg.edu.model.db.StudentInfo;
import com.beyondsoft.sabg.edu.repository.core.SimpleRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author Mo cr
 * @Date 2023/8/16
 */
public interface StudentRepo extends SimpleRepository<StudentInfo> {
    List<StudentInfo> findByStudentName(String name);
    List<StudentInfo> findByStudentNumberIn(List<String> studentNumbers);

    List<StudentInfo> findByStudentNumber(String studentNumber);

    @Query(value="select id from student_info where student_name=?1 or student_number=?1",nativeQuery = true)
    List<Long> findByStudentNameOrStudentNumber(String keyword);

    List<StudentInfo> findByIdCard(String idCard);
}
